from typing import *
from math import inf


class Solution:
    def partitionArray(self, nums: List[int], k: int) -> int:
        nums.sort()
        s, ans = -inf, 0
        for v in nums:
            if v - s > k:
                s = v
                ans += 1
        return ans
